ti.ajax=function(url,data){
	var uniq=new Date().valueOf() + Math.random(1,10000);
	url += '?reqTime='+uniq;
	ti.ajax.requests[uniq]=ti.x.getHttpRequestor();
	ti.ajax.requests[uniq].onreadystatechange=Function(
		'',
		'ti.ajax.handleResponse(\''+uniq+'\')'
	);
	ti.ajax.requests[uniq].open('POST',url,true);
	ti.ajax.requests[uniq].setRequestHeader(
		'Content-Type',
		'application/x-www-form-urlencoded'
	);
	ti.ajax.requests[uniq].send(data);
}

ti.ajax.handleResponse=function(uniq){
	if(ti.ajax.requests[uniq].readyState == 4){
		eval('ti.ajax.responses[\''+uniq+'\']='+ti.ajax.requests[uniq].responseText);
		for(var key in ti.ajax.responses[uniq]){
			if(ti.ajax.responses[uniq][key]!= ''){
				obj=ti(key);
				if(obj && key != 'js'){
					if(ti.x.isIe){
						obj.innerHTML = '<div style="width: 100%;height: 100%;">'+ti.ajax.responses[uniq][key]+'</div>';
					}else{
						obj.innerHTML = ti.ajax.responses[uniq][key];
					}
					//
				}
			}
		}
		if(!ti.empty(ti.ajax.responses[uniq]['js'])){
			//alert(ti.ajax.responses[uniq]['js']);
			eval(ti.ajax.responses[uniq]['js']);
		}
	}
}

ti.ajax.requests={};
ti.ajax.responses={};
